<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8" indent="no"/>
<!-- 
Look at this page http://red-orange.cn/wiki/index.php/Messages_and_Constants for more information.
 -->
<xsl:param name="language" />
<xsl:param name="defaultLanguage" select="en" />

<xsl:template match="/">
<xsl:for-each select="/all/object/caption[@language=$language]">
<xsl:choose>
    <xsl:when test="@table"> 
<xsl:value-of select="../@name"/>.table=<xsl:value-of select="@table"/>
<xsl:text>&#xa;</xsl:text>  
    </xsl:when>
    <xsl:otherwise>
<xsl:value-of select="../@name"/>.table=<xsl:value-of select="@form"/>
<xsl:text>&#xa;</xsl:text>   
    </xsl:otherwise>  
</xsl:choose>
<xsl:value-of select="../@name"/>.form=<xsl:value-of select="@form"/>
<xsl:text>&#xa;</xsl:text>
</xsl:for-each>
<xsl:for-each select="//attributes/*[child::caption[@language=$language]]">
<xsl:variable name="object"><xsl:value-of select="../../@name"/></xsl:variable>
<xsl:variable name="attribute"><xsl:value-of select="@fieldName"/></xsl:variable>
<xsl:for-each select="caption[@language=$language]">
<xsl:choose>
    <xsl:when test="@table"> 
<xsl:value-of select="$object"/>.<xsl:value-of select="$attribute"/>.table=<xsl:value-of select="@table"/>
<xsl:text>&#xa;</xsl:text>  
    </xsl:when>
    <xsl:otherwise>
<xsl:value-of select="$object"/>.<xsl:value-of select="$attribute"/>.table=<xsl:value-of select="@form"/>
<xsl:text>&#xa;</xsl:text>   
    </xsl:otherwise>  
</xsl:choose>
<xsl:value-of select="$object"/>.<xsl:value-of select="$attribute"/>.form=<xsl:value-of select="@form"/>
<xsl:text>&#xa;</xsl:text>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="//attributes/*[child::help[@language=$language]]">
<xsl:variable name="object"><xsl:value-of select="../../@name"/></xsl:variable>
<xsl:variable name="attribute"><xsl:value-of select="@fieldName"/></xsl:variable>
<xsl:for-each select="help[@language=$language]">
<xsl:value-of select="$object"/>.<xsl:value-of select="$attribute"/>.help=<xsl:value-of select="text()"/>
<xsl:text>&#xa;</xsl:text>
</xsl:for-each>
</xsl:for-each>

<xsl:for-each select="//attributes/enum[@scope='local']/*[child::caption[@language=$language]]">
<xsl:variable name="object"><xsl:value-of select="../../../@name"/></xsl:variable>
<xsl:variable name="attribute"><xsl:value-of select="../@fieldName"/></xsl:variable>
<xsl:variable name="value"><xsl:value-of select="@name"/></xsl:variable>
<xsl:for-each select="caption[@language=$language]">
<xsl:choose>
    <xsl:when test="@table"> 
<xsl:value-of select="$object"/>.<xsl:value-of select="$attribute"/>.<xsl:value-of select="$value"/>.table=<xsl:value-of select="@table"/>
<xsl:text>&#xa;</xsl:text>  
    </xsl:when>
    <xsl:otherwise>
<xsl:value-of select="$object"/>.<xsl:value-of select="$attribute"/>.<xsl:value-of select="$value"/>.table=<xsl:value-of select="@form"/>
<xsl:text>&#xa;</xsl:text>   
    </xsl:otherwise>  
</xsl:choose>
<xsl:value-of select="$object"/>.<xsl:value-of select="$attribute"/>.<xsl:value-of select="$value"/>.form=<xsl:value-of select="@form"/>
<xsl:text>&#xa;</xsl:text>
</xsl:for-each>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>